package com.lintf.web.controller.bot;

import com.lintf.bot.domain.dto.BotDailyAddDTO;
import com.lintf.bot.domain.dto.BotDailyListDTO;
import com.lintf.bot.domain.dto.BotDailyUpdateDTO;
import com.lintf.bot.service.IBotDailyService;
import com.lintf.common.core.controller.BaseController;
import com.lintf.common.core.domain.AjaxResult;
import com.lintf.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @ system:Mac
 * @ author:lin tingfeng
 * @ data:2024/1/7 15:14
 * @ package_name:com.lintf.web.controller.bot
 * @ project_name:mobile-project
 * @ desc:
 */
@RestController
@RequestMapping("/bot/daily")
public class BotDailyController extends BaseController {

    @Autowired
    private IBotDailyService botDailyService;

    @GetMapping("/list")
    public TableDataInfo list(BotDailyListDTO dto) {
        return getDataTable(botDailyService.list(dto));
    }

    @GetMapping("/ownList")
    public TableDataInfo ownList(BotDailyListDTO dto) {
        return getDataTable(botDailyService.ownList(dto));
    }

    @PostMapping("/add")
    public AjaxResult add(@RequestBody BotDailyAddDTO dto) {
        botDailyService.add(dto);
        return AjaxResult.success();
    }

    @PostMapping("/update")
    public AjaxResult update(@RequestBody BotDailyUpdateDTO dto) {
        botDailyService.update(dto);
        return AjaxResult.success();
    }

    @PostMapping("/remove")
    public AjaxResult remove(@RequestBody BotDailyUpdateDTO dto) {
        botDailyService.remove(dto);
        return AjaxResult.success();
    }

}
